package com.education.online.service.impl;


import com.education.common.utils.Convert;
import com.education.online.mapper.OCatalogLessonMapper;
import com.education.online.pojo.OCatalogLesson;
import com.education.online.service.OCatalogLessonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 专业课程体系表 服务层实现
 *
 * @author d
 * @date 2020-06-04 15:17:49
 */
@Service
public class OCatalogLessonServiceImpl implements OCatalogLessonService {

    @Autowired
    private OCatalogLessonMapper oCatalogLessonMapper;

    @Override
    public List<OCatalogLesson> selectOCatalogLessonByCatalogName(String catalogName) {
        return oCatalogLessonMapper.selectOCatalogLessonByCatalogName(catalogName);
    }

    @Override
    public List<OCatalogLesson> selectBuyOCatalogLessonByTwoMenuId(List<Integer> menuIds,Integer userId) {
        return oCatalogLessonMapper.selectBuyOCatalogLessonByTwoMenuId(menuIds,userId);
    }

    @Override
    public List<OCatalogLesson> selectNotBuyOCatalogLessonByTwoMenuId(List<Integer> menuIds, Integer id) {
        return oCatalogLessonMapper.selectNotBuyOCatalogLessonByTwoMenuId(menuIds,id);
    }

    @Override
    public List<OCatalogLesson> selectOCatalogLessonByUserId(Integer userId,Integer id) {
        return oCatalogLessonMapper.selectOCatalogLessonByUserId(userId,id);
    }

    @Override
    public List<OCatalogLesson> selectNotOCatalogLessonByUserId(Integer userId,Integer id) {
        return oCatalogLessonMapper.selectNotOCatalogLessonByUserId(userId,id);
    }

    //查询专业课程体系表信息
    @Override
    public OCatalogLesson selectOCatalogLessonById(Integer id) {
        return oCatalogLessonMapper.selectOCatalogLessonById(id);
    }

    // 查询专业课程体系表列表
    @Override
    public List<OCatalogLesson> selectOCatalogLessonList(OCatalogLesson oCatalogLesson) {
        return oCatalogLessonMapper.selectOCatalogLessonList(oCatalogLesson);
    }

    // 新增专业课程体系表
    @Override
    public int insertOCatalogLesson(OCatalogLesson oCatalogLesson) {
        return oCatalogLessonMapper.insertOCatalogLesson(oCatalogLesson);
    }

    //修改专业课程体系表
    @Override
    public int updateOCatalogLesson(OCatalogLesson oCatalogLesson) {
        return oCatalogLessonMapper.updateOCatalogLesson(oCatalogLesson);
    }

    //删除专业课程体系表对象
    @Override
    public int deleteOCatalogLessonByIds(String ids) {
        return oCatalogLessonMapper.deleteOCatalogLessonByIds(Convert.toStrArray(ids));
    }
}